package designMode.strategyPatter.demo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 陆离
 * 2023/11/6 11:10:50
 * 策略设计模式
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Test implements Serializable {
    private String name;

    public MsgResult msgResult(){
        return msgResult(CLassesStrategy.ZHANG);
    }

    public MsgResult msgResult(String nameKeys){
        Classes classes = CLassesStrategy.get(nameKeys);
        System.out.println("本节课是：" + classes.getName() + "授课");
        System.out.println("请打开" + classes.getClassName() + "课本");
        return classes.msgResult(classes.getName(),classes.getClassName(),String.valueOf(classes.getStatusCode("0")));
    }

    public static void main(String[] args) {
        Test test = new Test();
        System.out.println(test.msgResult(CLassesStrategy.GUO1));
    }
}
